/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package daa.levelup.forTasks;

import java.util.Scanner;

public class ABsum {

    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("Enter number A (A>=1)");
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();
        int total = 0;

        if (number < 1) {
            return;
        } else {
            System.out.println("Enter number B (A<B<=100)");
        }
        int number2 = sc.nextInt();
        if (number2 > 100) {
            return;
        }
        for (int i = number; i < number2 + 1; ++i) {
            total += i;
            if (i == number2) {
                break;
             
            }
        }
        System.out.println("Сумма=" + total);
    }

}
